package com.ch13;

import com.ch13.config.AppConfig;
import com.ch13.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @ClassName Main
 * @Description TODO
 * @Author Kx
 * @Date 2025/5/6 19:06
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        // 读取配置类
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        // 获取业务层对象
        UserService bean = context.getBean(UserService.class);

        bean.save("张三");
    }
}
